#include "tunemanual.h"

TuneManual::TuneManual()
{

}

QHash<QString,HopScanPara> TuneManual::GetHopScanParas()
{
    return hopScanParas;
}

bool TuneManual::SetHopScanPara(QString name,HopScanPara hopScanPara)
{
    hopScanParas[name]=hopScanPara;
    return true;
}
bool TuneManual::AddHopScanPara(QString name,HopScanPara hopScanPara)
{
    if(hopScanParas.contains(name)) return false;
    hopScanParas.insert(name,hopScanPara);
    return true;
}
HopScanPara TuneManual::GetHopScanPara(QString name)
{
    return hopScanParas.value(name);
}
bool TuneManual::RemoveHopScanPara(QString name)
{
    hopScanParas.remove(name);
    return true;
}
//
QList<SweepScanPara> TuneManual::GetSweepScanParas()
{
    return sweepScanParas;
}
bool TuneManual::SetSweepScanParas(QList<SweepScanPara> paras)
{
    sweepScanParas=paras;
}
bool TuneManual::SetSweepScanPara(int index,SweepScanPara sweepScanPara)
{
    sweepScanParas[index]=sweepScanPara;
    return true;
}
SweepScanPara TuneManual::GetSweepScanPara(int index)
{
    return sweepScanParas[index];
}

bool TuneManual::RemoveSweepScanPara(int index)
{
    sweepScanParas.removeAt(index);
    return true;
}
bool TuneManual::AddSweepScanPara(SweepScanPara sweepScanPara)
{
    sweepScanParas.append(sweepScanPara);
    return true;
}

 QDataStream & operator<< ( QDataStream & stream, const TuneManual & tuneManual )
 {
     stream<<tuneManual.hopScanParas
           <<tuneManual.sweepScanParas;
     return stream;
 }
 QDataStream &	operator>> ( QDataStream & stream, TuneManual & tuneManual )
 {
     stream>>tuneManual.hopScanParas
           >>tuneManual.sweepScanParas;
     return stream;
 }
